<script src="<?= base_url(); ?>third_party/ckeditor/ckeditor.js"></script>
<?php if($mode == 'VIEW') { ?>
<div class="grid_7">
    <div class="box">
        <h2>
            <a href="#" id="toggle-tables">Content Management   </a>
        </h2>
        <div class="block" >
            <form name="banner" method="POST" enctype="multipart/form-data" action="<?= base_url(); ?>admin/cms/submit/update/<?= $cms['info']->id;?>">
                <fieldset>
                    <legend>Content  Management : </legend>
                    <div class="field" >
                        <?php if ($this->session->flashdata('message')) { ?>
                            <div id="red"> <?= $this->session->flashdata('message'); ?></div>
                        <?php } ?>
                    </div>
                    <div class="field" style="float:left">
                        <label> Title</label>
                        <input name="title" type ="text" size="42" value="<?= $cms['info']->title; ?>" />
                    </div>
                    <div class="field" style="float:left">
                        <label> Meta Title</label>
                        <input name="meta_title" type ="text" size="125" value="<?= $cms['info']->meta_title; ?>" />
                    </div>
                    <div class="field" style="float:left">
                        <label> Meta Keyword</label>
                        <input name="meta_keyword" type ="text" size="125" value="<?= $cms['info']->meta_keyword; ?>" />
                    </div>

                    <div class="field" style="float:left">
                        <label> Meta Description</label>
                        <textarea name="meta_description" rows="3" cols="80" ><?= $cms['info']->meta_description;?></textarea>
                    </div>
                    <div class="field" style="float:left; width: 99%">
                        <label> Description</label>
                        <textarea id="cms_detail" name="cms_detail"><?= $cms['info']->description;?></textarea>
                        <script type="text/javascript">
                            //<![CDATA[
                            CKEDITOR.replace( 'cms_detail',
                            {
                                skin : 'v2',
                                enterMode : CKEDITOR.ENTER_DIV,
                                toolbar :
                                    [
                                    [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                                    [ 'UIColor' ]
                                ]

                            });
                            //]]>
                        </script>
                    </div> 
                    <div class="clearfix"></div>
                    </br>
                    <div class="field" style="float:left">
                        <input type="submit" value="Update" name="insert_cms"/>
                    </div>
                </fieldset>
            </form>



        </div>
    </div> <!-- END OF BOX -->


</div>

<?php } else { ?>




<div class="grid_7">
    <div class="box">
        <h2>
            <a href="#" id="toggle-tables">Content Management  </a>
        </h2>
        <div class="block" >
            <form name="banner" method="POST" enctype="multipart/form-data" action="<?= base_url(); ?>admin/cms/submit/add/0">
                <fieldset>
                    <legend>Content  Management : </legend>
                    <div class="field" >
                        <?php if ($this->session->flashdata('message')) { ?>
                            <div id="red"> <?= $this->session->flashdata('message'); ?></div>
                        <?php } ?>
                    </div>
                    <div class="field" style="float:left">
                        <label> Title</label>
                        <input name="title" type ="text" size="42" value="<?= set_value('title'); ?>" />
                    </div>
                    <div class="field" style="float:left">
                        <label> Meta Title</label>
                        <input name="meta_title" type ="text" size="125" value="<?= set_value('meta_title'); ?>" />
                    </div>
                    <div class="field" style="float:left">
                        <label> Meta Keyword</label>
                        <input name="meta_keyword" type ="text" size="125" value="<?= set_value('meta_keyword'); ?>" />
                    </div>

                    <div class="field" style="float:left">
                        <label> Meta Description</label>
                        <input name="meta_description" type ="text" size="125" value="<?= set_value('meta_description'); ?>" />
                    </div>
                    <div class="field" style="float:left; width: 99%">
                        <label> Description</label>
                        <textarea id="cms_detail" name="cms_detail"><?= set_value('cms_detail'); ?></textarea>
                        <script type="text/javascript">
                            //<![CDATA[
                            CKEDITOR.replace( 'cms_detail',
                            {
                                skin : 'v2',
                                enterMode : CKEDITOR.ENTER_DIV,
                                toolbar :
                                    [
                                    [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                                    [ 'UIColor' ]
                                ]

                            });
                            //]]>
                        </script>
                    </div> 
                    <div class="clearfix"></div>
                    </br>
                    <div class="field" style="float:left">
                        <input type="submit" value="Add Page" name="insert_cms"/>
                    </div>
                </fieldset>
            </form>



        </div>
    </div> <!-- END OF BOX -->


</div>

<?php } ?>



